package be.rhok.eenzaamheidswijzer.model;

import org.hibernate.annotations.Cascade;

import javax.persistence.*;
import java.util.List;

@Entity
@Table(name = "EW_QUESTION", schema = "RHOK")
public class Question {
    @Id
    private long id;

    @Column(length = 4000)
    private String dutchValue = "";

    @OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY)
    @Cascade({org.hibernate.annotations.CascadeType.DELETE_ORPHAN})
    @JoinColumn(name = "question_id", nullable = false)
    private List<Answer> answers;

    public long getId() {
        return id;
    }

    public void setId(long id) {
        this.id = id;
    }

    public String getDutchValue() {
        return dutchValue;
    }

    public void setDutchValue(String dutchValue) {
        this.dutchValue = dutchValue;
    }

    public List<Answer> getAnswers() {
        return answers;
    }

    public void setAnswers(List<Answer> answers) {
        this.answers = answers;
    }
}